package br.com.mundodaprata.store.testes;

import java.util.ArrayList;
import java.util.List;

public class Boxing {
	
	public static void main(String[] args) {
		//boxing ==> primitivo para wrapper
		//unboxing ==> wrapper para primitivo
		
		Integer n1 = new Integer(10);
		int n2 = 9;
		n1 = new Integer(n2);
		n2 = n1.intValue();
		n1 = n2;
		n2 = n1;
		List<Integer> list = new ArrayList<Integer>();
		list.add(1);
		list.add(2);
		list.add(3);
		n2 = list.get(0);
		
		Double d1 = new Double(2.5);
		double d2 = 2.8;
		d1 = new Double(d2);
		d2 = d1.doubleValue();
		d1 = d2;
		d2 = d1;
		
		Float f1 = new Float(3.6);
		float f2 = 3.6f;
		f1 = new Float(f2);
		f2 = f1.floatValue();
		f1 = f2;
		f2 = f1;
		
		Short s1 = new Short((short) 3);
		short s2 = 256;
		s1 = new Short(s2);
		s2 = s1.shortValue();
		s1 = s2;
		s2 = s1;
		
		Byte b1 = new Byte((byte) 12);
		byte b2 = 127;
		b1 = new Byte(b2);
		b2 = b1.byteValue();
		b1 = b2;
		b2 = b1;
		
		Long l1 = new Long(12356);
		long l2 = 12356;
		l1 = new Long(l2);
		l2 = l1.longValue();
		l1 = l2;
		l2 = l1;
		
		Boolean v1 = new Boolean(true);
		boolean v2 = true;
		v1 = new Boolean(v2);
		v2 = v1.booleanValue();
		v1 = v2;
		v2 = v1;
	}

}